home *** CD-ROM | disk | FTP | other *** search
-
- % -----------------------------------------------------------------------------
- % Main PreScription Demonstration Script *TERMINATE PRESCRIPTION*
- % -----------------------------------------------------------------------------
- %
- % Version : 1.00
- % Filename : DEMO.TSL
- % Company : SerWiz Comm
- % Programmer : The Serial Wizard
- % Module created : 06 Aug 1995
- % Latest revision : 25 Jul 1997
- % Language/version : Terminate Prescription 1.00
- % Remarks : Demonstrates most functions of the script language
- %
- % -----------------------------------------------------------------------------
-
- Include demo.inc
-
- Set Menus=11
- Set MenuLine=1
- Set MenuHead=30
- Set MenuText=7
- Set MenuTextHigh=3
- Set MenuTextBold=14
- Set Edit=11
- Set MenuBar=113
-
- Cursor 0
- SetAttr 3
- ClearScreen
-
- Stars(0)
-
- SetAttr 3
- WriteStr 1, 1,"▄▄▄▄▄▄▄"
- WriteStr 1, 2,"░ ▀▄"
- WriteStr 1, 3,"▀▀▀█▀▀▄ █ ┌──────┐ ┌─────┐ PreScription"
- WriteStr 1, 4,"░ █▀▀ ▄▀ │ ┌──┐ │ │ ┌───┘ ────────────"
- WriteStr 1, 5,"▒ █▄▄▄▀ │ └──┘ │ │ └─┐ ┌────┐ The Script Language for Terminate"
- WriteStr 1, 6,"▓ █ │ ┌─┐ ┌┘ │ ┌─┘ └────┘ that will cure your problem"
- WriteStr 1, 7,"█ █ │ │ │ └┐ │ └───┐"
- WriteStr 1, 8,"▀▀▀▀ └─┘ └──┘ └─────┘ Version 1.00"
- AttrBlock 1,8,80,8,11
- AttrBlock 54,3,66,3,14
- AttrBlock 54,4,66,4,1
- WriteStr 1, 9," ▄▄▄▄▄▄▄▄"
- WriteStr 1,10," ▄▀ █"
- WriteStr 1,11," ░ ░▀▀▀▀ ┌─────┐ ┌──────┐ ┌───┐ ┌─────┐ ┌─────┐ ┌───┐ ┌──────┐ ┌───┐ ┌─┐"
- WriteStr 1,12," ▀▄ ▀▄ │ ┌─┐ │ │ ┌──┐ │ └┐ ┌┘ │ ┌─┐ │ └─┐ ┌─┘ └┐ ┌┘ │ ┌──┐ │ │ └┐ │ │"
- WriteStr 1,13," ▀▀▄ ▀▄ │ │ └─┘ │ └──┘ │ │ │ │ └─┘ │ │ │ │ │ │ │ │ │ │ ├┐ └┐│ │"
- WriteStr 1,14," ▄▄▄▄▓ █ │ │ ┌─┐ │ ┌─┐ ┌┘ │ │ │ ┌───┘ │ │ │ │ │ │ │ │ │ │└┐ └┤ │"
- WriteStr 1,15," █ ▄▀ │ └─┘ │ │ │ │ └┐ ┌┘ └┐ │ │ │ │ ┌┘ └┐ │ └──┘ │ │ │ └┐ │"
- WriteStr 1,16," ▀▀▀▀▀▀▀▀ └─────┘ └─┘ └──┘ └───┘ └─┘ └─┘ └───┘ └──────┘ └─┘ └───┘"
- AttrBlock 1,16,80,16,11
- WriteAStr 30,19,11,"The Demonstration"
- WriteAStr 27,22,112," Press ENTER to begin. "
- WaitEnter
-
- PopScreen(0)
-
- ClearScreen
- Box 1,1,scrcol,4,113,6
- FillBlock 1,5,scrcol,scrlen-2,7,"▒"
- FillBlock 1,scrlen-1,scrcol,scrlen-1,1,"─"
- Set Header="TERMINATE PRESCRIPTION PROGRAMMING LANGUAGE"
- Set coldiv2=scrcol/2
- WriteAStr coldiv2-(Length(Header)/2)+1,2,MenuBar,Header
- WriteStr coldiv2-35,3,"Copyright (c) 1992,97 by Strathrory Systems Limited. All Rights Reserved"
- WriteAStr 2,6,112," Demonstration "
- WriteStr 2,7," Script "
- WriteStr 2,8," DEMO.TSL "
- Window coldiv2-17,6,coldiv2+18,21,3,1,Menus,MenuText,MenuHead," Script menu "
-
- WriteAStr 2, 1,MenuText,"PreScription"
- WriteStr 2, 2,"What can a script do for me ?"
- WriteStr 2, 3,"Compiling scripts"
- WriteStr 2, 4,"Language syntax"
- WriteStr 2, 5,"Program structure"
- WriteStr 2, 6,"Expressions and operators"
- WriteStr 2, 7,"User defined functions"
- WriteStr 2, 8,"Statements"
- WriteStr 2, 9,"Loops"
- WriteStr 2,10,"Built-in functions"
- WriteStr 2,11,"Demonstrations"
- WriteStr 2,12,"Error messages"
- WriteStr 2,13,"Script examples"
- WriteStr 2,14,"Copyright information"
-
- Set x=1
- Set y=1
- Set z=1
-
- :Select
- SetBarTxt 1,"What is the story behind PreScription"
- SetBarTxt 2,"Why would I ever need a script ?"
- SetBarTxt 3,"How do you compile scripts"
- SetBarTxt 4,"What does the language look like"
- SetBarTxt 5,"How does a program look like"
- SetBarTxt 6,"Logical or not is the question"
- SetBarTxt 7,"How do I make my own functions"
- SetBarTxt 8,"You need to make a statement"
- SetBarTxt 9,"Repeat Until, For Next, While EndWhile"
- SetBarTxt 10,"How do I use the built-in functions and commands"
- SetBarTxt 11,"See some interesting demonstrations"
- SetBarTxt 12,"What does this error message mean"
- SetBarTxt 13,"Some small script examples and description on how they work"
- SetBarTxt 14,"As usual we need to mention this"
- set x=selectbar(1,14,x,MenuBar,1,0,scrlen)
-
- If x=0
- Goto End
- Endif
- If x=1
- Gosub PreScription
- Endif
- If x=2
- Gosub What4me
- Endif
- If x=3
- Gosub Compile
- Endif
- If x=4
- Gosub LanguageSyntax
- Endif
- If x=5
- Gosub ProgramStructure
- Endif
- If x=6
- Gosub ExpressionOperator
- Endif
- If x=7
- Gosub ShowFunc
- Endif
- If x=8
- Gosub Statements
- Endif
- If x=9
- Gosub Loops
- Endif
- If x=10
- Gosub BuiltIn
- Endif
- If x=11
- Gosub CoolDemos
- Endif
- If x=12
- Gosub ErrorMsg
- Endif
- If x=13
- Gosub Examples
- Endif
- If x=14
- Gosub Copyright
- Endif
-
- Goto Select
-
- :PreScription
- Window coldiv2-38,6,coldiv2+38,22,3,1,Menus,MenuText,MenuHead," PreScription "
- SetAttr 7
- GotoXY 1,3
- PrintLn " Many users had asked us to implement a basic script language for their"
- PrintLn " communication needs. We realised that the need for such a capability was"
- PrintLn " important since Terminate could not support everything in the"
- PrintLn " communication world, so we decided to built a complete basic programming"
- PrintLn " language, that would handle most of the functions a programmer would"
- PrintLn " need."
- PrintLn
- PrintLn " PreScription is medicine and with a little programming experience, there"
- PrintLn " is a good chance that it can cure your problem."
- PrintLn
- PrintLn " This demonstration script was made by Bo Bendtsen, SerWiz Comm"
- WaitEnter
- Removewindow
- Return
-
- :What4me
- Window coldiv2-38,6,coldiv2+38,22,3,1,Menus,MenuText,MenuHead," Many things "
- SetAttr 7
- GotoXY 1,3
- PrintLn " If you have a problem you need to get solved or automated, the script"
- PrintLn " language is perfect. If you cannot program you can ask a programmer"
- PrintLn " to help you. It can also be used for adding additional functions and"
- PrintLn " features to Terminate and gives other programmers the opportunity"
- PrintLn " to add things that we did not think of."
- PrintLn
- PrintLn " We have tried to make the language as simple as possible, but still"
- PrintLn " allowing the programmers access to all the difficult functions in your"
- PrintLn " PC, so the language would work both for beginners and experienced"
- PrintLn " programmers. If you have any suggestions we are very interested in"
- PrintLn " hearing from you as soon as possible."
- WaitEnter
- Removewindow
- Return
-
- :Compile
- Window coldiv2-38,6,coldiv2+38,21,3,1,Menus,MenuText,MenuHead," Compiling scripts "
- SetAttr 7
- GotoXY 1,3
- PrintLn " PreScription compiles the .TSL source files into .TSC compiled files"
- PrintLn " and run the .TSC files. PreScription does not need the original source"
- PrintLn " files, so you can make your programs and distribute without giving away"
- PrintLn " all your knowledge."
- PrintLn
- PrintLn " If you make your own script and distribute, you are the copyright owner"
- PrintLn " of the script and can decide under which conditions you want to release."
- PrintLn " If you make a good script that you think is good enough to be included"
- PrintLn " in Terminate, please send the .TSL file to the nearest registration site."
- WaitEnter
- Removewindow
- Return
-
- :LanguageSyntax
- Window coldiv2-38,9,coldiv2+38,16,3,1,Menus,MenuText,MenuHead," Language syntax "
- SetAttr 7
- GotoXY 1,3
- PrintLn " The syntax for PreScription is Pascal/Basic. You can read specific"
- PrintLn " details on all the commands in the documentation."
- WaitEnter
- Removewindow
- Return
-
- :ProgramStructure
- Window coldiv2-38,9,coldiv2+38,16,3,1,Menus,MenuText,MenuHead," Language syntax "
- SetAttr 7
- GotoXY 1,3
- PrintLn " With PreScription you do not need to define or assign anything, you can"
- PrintLn " start making your program right out of the box, without complicated setup."
- WaitEnter
- Removewindow
- Return
-
- :ExpressionOperator
- Window coldiv2-38,6,coldiv2+38,20,3,1,Menus,MenuText,MenuHead," Expressions "
- SetAttr 7
- GotoXY 1,3
- PrintLn " When programming you need expressions for evaluation purposes."
- PrintLn " An expression contain operators, constants and variables."
- PrintLn
- PrintLn " Apples <- Variable"
- PrintLn " 1000 <- Constant"
- PrintLn " + <- Operator"
- PrintLn
- PrintLn " Apples + 1000 <- Expression"
- WaitEnter
- Removewindow
- Return
-
- :ShowFunc
- Window coldiv2-38,9,coldiv2+38,18,3,1,Menus,MenuText,MenuHead," Functions "
- SetAttr 7
- GotoXY 1,3
- PrintLn " If you need other functions than the ones that are built-in in"
- PrintLn " PreScription, you can define your own, which can be called from"
- PrintLn " all over the script."
- PrintLn " Instructions on how to create your own can be found in the documentation."
- WaitEnter
- Removewindow
- Return
-
- :Statements
- Window coldiv2-38,7,coldiv2+38,18,3,1,Menus,MenuText,MenuHead," Statements "
- SetAttr 7
- GotoXY 1,3
- PrintLn " Whenever you need to evaluate an expression you use a statement."
- PrintLn " If Else Endif are the commands used for evaluation."
- PrintLn
- PrintLn " If Apples > 1000 <- If Statement is true do! "
- PrintLn " Print Apples"
- PrintLn " Endif"
- WaitEnter
- Removewindow
- Return
-
- :Loops
- Window coldiv2-38,6,coldiv2+38,22,3,1,Menus,MenuText,MenuHead," Loops "
- SetAttr 7
- GotoXY 1,2
- PrintLn " PreScription support 3 ways of looping."
- PrintLn
- SetAttr 14
- PrintLn " For Next"
- SetAttr 7
- PrintLn
- PrintLn " Perform a loop a specific number of times"
- PrintLn
- SetAttr 14
- PrintLn " Repeat Until"
- SetAttr 7
- PrintLn
- PrintLn " Continue looping until expression is true"
- PrintLn
- SetAttr 14
- PrintLn " While Endwhile"
- SetAttr 7
- PrintLn
- PrintLn " Continue looping while expression is true"
- Set Key=0
- For Count,1,1000000,27
- WriteAStr 60,2,11,Count
- If Keypressed<>0
- Set Key = GetKey
- Set Count=1000000
- Endif
- Next
- Removewindow
- Return
-
- :BuiltIn
- Window coldiv2-38,9,coldiv2+38,17,3,1,Menus,MenuText,MenuHead," Built-in functions "
- SetAttr 7
- GotoXY 1,3
- PrintLn " PreScription has many built-in functions which can be accessed from your"
- PrintLn " script, but also many functions which accesses Terminate functions"
- PrintLn " which gives you control over Terminate."
- WaitEnter
- Removewindow
- Return
-
- :CoolDemos
- Window coldiv2-35,8,coldiv2-5,18,3,1,Menus,MenuText,MenuHead," Demonstration scripts "
- WriteAStr 2, 1,MenuText,"Launch menu"
- Repeat
- SetBarTxt 1,"Start up external programs"
- set y=selectbar(1,2,y,MenuBar,1,0,scrlen)
- If y=1
- Window coldiv2-25,10,coldiv2,20,3,1,Menus,MenuText,MenuHead," Launch menu "
- WriteAStr 2, 1,MenuText,"Screen Blanker"
- WriteStr 2, 2,"TerMail"
- Repeat
- SetBarTxt 1,"Run external screen blanker"
- SetBarTxt 2,"Run external mail editor"
- set z=selectbar(1,9,z,MenuBar,1,0,scrlen)
- If z=1
- Exec "UTILS\BLANKER.EXE !M"
- Endif
- If z=2
- Exec "TERMAIL\TM.EXE !M"
- Endif
- If z>2
- WriteStr 2,z,"Soon available"
- Endif
- Until z=0
- RemoveWindow
- Endif
- Until y=0
- Removewindow
- Return
-
- :ErrorMsg
- Window coldiv2-38,9,coldiv2+38,18,3,1,Menus,MenuText,MenuHead," Error messages "
- SetAttr 7
- GotoXY 1,3
- PrintLn " Whenever you are programming you will without a doubt make many errors"
- PrintLn " that can make your program go into an endless loop or even hang your"
- PrintLn " machine. PreScription will try and give you the best error code"
- PrintLn " if an error should occur."
- WaitEnter
- Removewindow
- Return
-
- :Examples
- Window coldiv2-38,6,coldiv2+38,22,3,1,Menus,MenuText,MenuHead," Example files "
- SetAttr 7
- PrintLn " To demonstrate to script in practice we included the following:"
- PrintLn
- PrintLn " DEMO.TSL <- This demonstration script"
- PrintLn " ATTR.TSL <- Color example"
- PrintLn " DATAFILE.TSL <- Read from datafiles"
- PrintLn " DUMPFILE.TSL <- Dumps a file to screen"
- PrintLn " ERRORMSG.TSL <- Show all device messages"
- PrintLn " MINITERM.TSL <- Dumb terminal"
- PrintLn " SHOWANSI.TSL <- Show an ANSI file"
- PrintLn " SHOWDIR.TSL <- Show a directory"
- PrintLn " SHOWKEY.TSL <- A keyboard example"
- PrintLn " SHOWTEXT.TSL <- Show a textfile"
- PrintLn " TEXTATTR.TSL <- The color selector"
- PrintLn " TIMER.TSL <- Show how to use timers"
- AttrBlock 2,3,13,14,14
- WaitEnter
- Removewindow
- Return
-
- :Copyright
- Window coldiv2-38,2,coldiv2+38,22,3,1,Menus,MenuText,MenuHead," Copyright "
- SetAttr 7
- PrintLn " Notice of COPYRIGHT and EXCLUSION OF LIABILITY"
- PrintLn " Under local laws and according to the relevant international conventions,"
- PrintLn " ALL versions of Terminate are copyright 1992,97 of Strathrory Systems Ltd."
- PrintLn
- PrintLn " Worldwide distributor SerWiz Comm"
- PrintLn
- PrintLn " All Rights Reserved."
- PrintLn
- PrintLn " IN NO EVENT WILL STRATHRORY SYSTEMS LIMITED, SERWIZ COMM OR ASSOCIATES BE"
- PrintLn " LIABLE TO YOU FOR ADDITIONAL DAMAGES, INCLUDING ANY LOST PROFITS, LOST"
- PrintLn " SAVINGS, OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE"
- PrintLn " USE OR INABILITY TO USE PRESCRIPTION OR SCRIPTS FOR PRESCRIPTION, EVEN IF"
- PrintLn " WE HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES."
- PrintLn
- PrintLn " Succinctly: By using this program, you agree not to hold Strathrory"
- PrintLn " Systems Limited, SerWiz Comm or associates responsible for anything other"
- Print " than taking up a lot of disk space."
- WaitEnter
- Removewindow
- Return
-
-
-
- :End
- Removewindow
- PopScreen(0)
- ClearScreen
- Cursor 1
-
-